package com.beta.em.order;

import java.util.Objects;

/**
 * Created by lichao on 2016/12/6.
 */
public enum RefundStatus {

    INIT("init","无"),
    PENDING("pending","待确认"),
    AGREED("agreed","已同意");

    private String value;
    private String cnValue;

    RefundStatus(String value, String cnValue) {
        this.value = value;
        this.cnValue = cnValue;
    }

    public String getValue() {
        return value;
    }

    public String getCnValue() {
        return cnValue;
    }

    public static RefundStatus getRefundStatus(String value) {
        for (RefundStatus refundstatus : values()) {
            if (refundstatus.getValue().equals(value)) {
                return refundstatus;
            }
        }
        return null;
    }

    public static String getCnValue(String value){
        RefundStatus refundStatus=getRefundStatus(value);
        if(Objects.nonNull(refundStatus)){
            return refundStatus.getCnValue();
        }
        return "";
    }
}
